<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/static/libs/html5shiv.js"></script>
    <script type="text/javascript" src="/static/libs/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/static/plugins/hui/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css"
          href="/static/plugins/hui/h-ui.admin/css/H-ui.login.css"/>
    <link rel="stylesheet" type="text/css"
          href="/static/plugins/hui/h-ui.admin/css/style.css"/>
    <link rel="stylesheet" type="text/css"
          href="/static/libs/Hui-iconfont/1.0.9/iconfont.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="/static/libs/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>{{ msg }} - {{ handler.config['object'] }}-{{ handler.config["version"] }}</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
</head>
<body>
<input type="hidden" id="TenantId" name="TenantId" value=""/>
<div class="header"><h1>{{ msg }}</h1></div>
<div class="loginWraper">
    <div id="loginform" class="loginBox">
        <form role="form" method="post" class="form form-horizontal" id="form-admin-add" action="/account/login">
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
                <div class="formControls col-xs-5">
                    {% autoescape None %}
                    {{ form.name }}
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
                <div class="formControls col-xs-5">
                    {{ form.password }}
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe720;</i></label>
                <div class="formControls col-xs-3">
                    {{ form.captcha }}
                </div>
                <div class="formControls col-xs-3">
                    <a href="javascript:void(0);" onclick="get_image_code()"><img class="get_image_code" src="" alt=""></a>
                </div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-5 col-xs-offset-3">
                    {% module xsrf_form_html() %}
                    {{ form.submit }}
                    <input name="" type="reset" class="btn btn-default radius size-L"
                           value="取&nbsp;&nbsp;消">
                </div>
            </div>
        </form>
    </div>
</div>
<div class="footer" style="font-size: 14px;">{{ handler.config['Copyright'] }} - {{ handler.config['stack'] }}</div>
<script type="text/javascript" src="/static/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/static/libs/layer/3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/plugins/hui/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/static/plugins/hui/h-ui.admin/js/dialog.js"></script>
<script type="text/javascript" src="/static/libs/js/commons.js"></script>
<script>
    //    生成验证码
    function get_image_code() {
        var d = Math.round(new Date().getTime() / 1000);
        $(".get_image_code").attr("src", "/utils/captcha/" + d);
    }

    $(document).ready(function () {
        get_image_code()
    });
    $(".button").click(function () {
        var postData = {};
        var data = $("form").serializeArray();
        $.each(data, function () {
            postData[this.name] = this.value;
        });
        $.ajax({
            url: "/passport/account/login?next={{ next_url }}",
            type: "post",
            data: JSON.stringify(postData),
            'headers': {
                'X-XSRFTOKEN': get_cookie("_xsrf")
            },
            'success': function (result) {
                if (result.status === true) {
                    layer.msg(result.message, {icon: 1, time: 1000});
                    setTimeout(function () {
                        window.location = result.url;
                    }, 1000)
                } else {
                    layer.msg(result.message, {icon: 5, time: 2000})
                }
            }
        });
    });
</script>
</body>
</html>
